package org.phoenixframework.common.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.phoenixframework.common.entity.base.BaseEntity;

import java.util.List;

/**
 * <p>
 * 系统部门表
 * </p>
 *
 * @author doublelife
 * @since 2021-05-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_dept")
@ApiModel(value="SysDept对象", description="系统部门表")
public class SysDept extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "父级部门ID")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty(value = "部门名字")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "部门code")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "排序")
    @TableField("sort")
    private Long sort;

    @ApiModelProperty(value = "层级")
    @TableField(exist = false)
    private Integer level;

    @ApiModelProperty(value = "下级")
    @TableField(exist = false)
    private List<SysDept> children;


}
